package com.person.leetcode.editor.cn;

/**
  * 461.汉明距离
  * 2022-10-08 17:12:48
**/
public class Sequence_0461_HammingDistance {
    public static void main(String[] args) throws InterruptedException {
//        Solution solution = new Sequence_0461_HammingDistance().new Solution();
        int x = 7,y=4;//111 100

        System.out.println(x&y);//相与
        System.out.println(x|y);//相或
        System.out.println(x^y);//异或

    }
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int hammingDistance(int x, int y) {
        int res = x ^ y;
        return Integer.bitCount(res);
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}